<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/resources/modelo_facelets.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">    

    <ui:define name="content">

        <p:panel id="painelFila" header="#{msgs.painelFila}">

            <h:form id="formTabela">        
                
                <p:messages />

                <p:dataTable id="tabela"  
                             value="#{fila.tabela}"
                             var="item"                                          
                             rows="10"  
                             pageLinks="5"
                             rowsPerPageTemplate="5,10,15"
                             selectionMode="single"
                             paginator="true"       
                             emptyMessage="Nenhum registro encontrado."
                             paginatorPosition="bottom"                             
                             paginatorTemplate="{RowsPerPageDropdown} {CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"                             
                             >

                    <p:column headerText="Numero" sortBy="#{item.id}">
                        <h:outputText value="#{item.id}"/>                              
                    </p:column>                      

                    <p:column headerText="Solicitante" sortBy="#{item.nomeSolicitante}" filterBy="#{item.nomeSolicitante}">
                        <h:outputText value="#{item.nomeSolicitante}"/>                              
                    </p:column> 
                    
                    <p:column headerText="Serviço" sortBy="#{item.nomeServico}" filterBy="#{item.nomeServico}">
                        <h:outputText value="#{item.nomeServico}"/>                              
                    </p:column> 
                    
                    <p:column headerText="Visualizar">
                        <p:commandButton value="Visualizar" action="#{fila.verChamado()}" ajax="false">
                            <f:setPropertyActionListener target="#{fila.idSelecionado}" value="#{item.id}" />
                        </p:commandButton>           
                    </p:column> 

                </p:dataTable>

            </h:form>           

        </p:panel>

    </ui:define>

</ui:composition>